package cn.itcast.nems.studentrecord.web.controller.b;

import cn.itcast.nems.journal.dto.JournalTransferLineDiscountCalcParams;
import cn.itcast.nems.journal.dto.JournalTransferLineDiscountCalcResult;
import cn.itcast.nems.journal.service.JournalTransferLineService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/b/journal/transfer/line")
@RequiredArgsConstructor
public class JournalTransferLineController {

    private final JournalTransferLineService journalTransferLineService;

    @PostMapping("/discount_calc")
    public ResponseEntity<JournalTransferLineDiscountCalcResult> discountCalc(
            @RequestBody JournalTransferLineDiscountCalcParams params
    ) {
        return ResponseEntity.ok(journalTransferLineService.discountCalc(params));
    }


}
